import request from '@/utils/request'

export function addProblem(data) {
  return request({
    url: '/hawk-eye/problem-record/create-log-problem',
    method: 'post',
    data: data
  })
}

export function problemPageList(query) {
  return request({
    url: '/hawk-eye/problem-record/page',
    method: 'get',
    params: query
  })
}

export function repairProblemPage(query) {
  return request({
    url: '/hawk-eye/problem-record/repair-problem-page',
    method: 'get',
    params: query
  })
}

export function problemDetail(id) {
  return request({
    url: '/hawk-eye/problem-record/detail/' + id,
    method: 'get'
  })
}

export function problemDetailByLog(baseAlarmId) {
  return request({
    url: '/hawk-eye/problem-record/detail-by-log/' + baseAlarmId,
    method: 'get'
  })
}

export function updateProblem(data) {
  return request({
    url: '/hawk-eye/problem-record/update',
    method: 'put',
    data: data
  })
}

export function resolveProblem(id) {
  return request({
    url: '/hawk-eye/problem-record/resolve/'+id,
    method: 'put'
  })
}


export function activateProblem(id) {
  return request({
    url: '/hawk-eye/problem-record/activate/'+id,
    method: 'put'
  })
}

export function closeProblem(id) {
  return request({
    url: '/hawk-eye/problem-record/close/'+id,
    method: 'put'
  })
}

export function removeProblem(id) {
  return request({
    url: '/hawk-eye/problem-record/remove/' + id,
    method: 'delete'
  })
}

export function problemDictList() {
  return request({
    url: '/hawk-eye/problem-record/problem-dict-list',
    method: 'get'
  })
}

export function dictListByType(type) {
  return request({
    url: '/hawk-eye/problem-record/dict-list-by-type/'+type,
    method: 'get'
  })
}

export function addDict(data) {
  return request({
    url: '/hawk-eye/problem-record/save-dict',
    method: 'post',
    data: data
  })
}

export function updateDict(data) {
  return request({
    url: '/hawk-eye/problem-record/update-dict',
    method: 'put',
    data: data
  })
}

export function removeDict(id) {
  return request({
    url: '/hawk-eye/problem-record/remove-dict/' + id,
    method: 'delete'
  })
}
